<?php

namespace So\Annotation;

use Attribute;
use Hyperf\Di\Annotation\AbstractAnnotation;

/**
 * Model模型注入
 * @Annotation
 * @Target("METHOD")
 * @author Saopig <1306222220@qq.com>
 */
#[Attribute(Attribute::TARGET_METHOD)]
class Model extends AbstractAnnotation
{

    /**
     * 是否自动query
     * query
     * @var bool
     */
    public bool $query = false;

    /**
     * 注入变量名称
     * var
     * @var string
     */
    public string $var = 'model';

    /**
     * 默认绑定场景
     * @param bool $value
     */
    public function __construct($value = false)
    {
        parent::__construct($value);
        $this->bindMainProperty('query', $value);
    }

}